/**   
 * @ClassName: PageUtils.java 
 * @Package com.vrv.common.util.pageutil 
 * @author LQ   
 * @date 2017年4月14日 上午2:25:54 
 * @version V1.0
 */
package com.vrv.common.util.page;

import java.io.Serializable;
import java.util.List;

/** 
 * PageUtils:分页工具类
 * @author LQ 
 */
public class PageUtils implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    //总记录数
    private long totalCount;
    //每页记录数
    private int pageSize;
    //总页数
    private int totalPage;
    //当前页数
    private int currPage;
    //列表数据
    private List<?> list;
    
    /**
     * 分页
     * @param list        列表数据
     * @param totalCount  总记录数
     * @param pageSize    每页记录数
     * @param currPage    当前页数
     */
    public PageUtils(List<?> list, long totalCount, int pageSize, int currPage) {
        this.list = list;
        this.totalCount = totalCount;
        this.pageSize = pageSize;
        this.currPage = currPage;
        this.totalPage = (int)Math.ceil((double)totalCount/pageSize);
    }

    /** 
     * @return totalCount 
     */
    public long getTotalCount() {
        return totalCount;
    }

    /** 
     * @param totalCount 要设置的 totalCount 
     */
    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }


    /** 
     * @return pageSize 
     */
    public int getPageSize() {
        return pageSize;
    }

    /** 
     * @param pageSize 要设置的 pageSize 
     */
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    /** 
     * @return totalPage 
     */
    public int getTotalPage() {
        return totalPage;
    }

    /** 
     * @param totalPage 要设置的 totalPage 
     */
    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    /** 
     * @return currPage 
     */
    public int getCurrPage() {
        return currPage;
    }


    /** 
     * @param currPage 要设置的 currPage 
     */
    public void setCurrPage(int currPage) {
        this.currPage = currPage;
    }

    /** 
     * @return list 
     */
    public List<?> getList() {
        return list;
    }

    /** 
     * @param list 要设置的 list 
     */
    public void setList(List<?> list) {
        this.list = list;
    }
    
}
